package com.daedalus.Polimorfizmi.Shapes;

import java.awt.Graphics;

import javax.swing.JComponent;


public abstract class MyShape extends JComponent{

	int xCoordinate;
	int yCoordinate;
	
	public MyShape(int x, int y){
		setX(x);
		setY(y);
		
		setSize(400,400);
		setLayout(null);
		setPosition();
	}
	
	public void setX(int x){
		xCoordinate=x>=0?x:0;
	}
	
	public void setY(int y){
		yCoordinate=y>=0?y:0;
	}
	
	public int getX(){
		return xCoordinate;
	}
	
	public int getY(){
		return yCoordinate;
	}
	
	public void setPosition(){
		this.setLocation(xCoordinate, yCoordinate);
	}
	
	public abstract void paint(Graphics g);
}
